package sctu.edu.java.year2016.team05.lizixin.day20160614.LianXi5;

/**
 * Created by home on 2016/6/14.
 * 12.2
 */
import java.io.File;
public class FileTest {
    public static void main(String[] args) {
        File file=new File("D:/JAVA","work.txt");
        if(file.exists()){
            String name=file.getName();
            long length=file.length();
            boolean hidden=file.isHidden();
            System.out.println("文件名称："+name);
            System.out.println("文件长度是："+length);
            System.out.println("该文件是隐藏文件吗？"+hidden);

        }else {
            System.out.println("该文件不存在");
        }

    }
}

